Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slight improvement #30

Closed
wants to merge 1 commit into from
Closed

Slight improvement #30

wants to merge 1 commit into from

Conversation

k06a
Copy link

@k06a k06a commented Oct 20, 2021

No description provided.

@mikec
Copy link
Contributor

mikec commented Nov 15, 2021

@k06a the functions in Account.sol are called via delegatecall by proxy account contracts. We need the domain separator to include the proxy account address, otherwise replay attacks are possible. The address(this) here https://github.com/brinktrade/brink-core/pull/30/files#diff-b56fb621b74da3c4dc71b48e24df782bbea726ad0ce58ef645b78d2461c85697L29 would be the address of the proxy account, but in the constructor it would be the address of the Account.sol deployed contract.

@mikec mikec closed this Dec 17, 2021
@k06a
Copy link
Author

k06a commented Dec 17, 2021

@mikec agree, can have immutable CACHED_THIS and CACHED_CHAIN_ID and use this cached DONAIN_SEPARATOR only if address of this and chain_id match immutables. Same way as it now works in OpenZeppelin solidity library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants